<?php

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\SubAccount\SubAccountController;
use App\Http\Controllers\SubAccount\SubAccountManageController;
use App\Http\Controllers\SubAccount\SubAccountLoginLogoutController;
use App\Http\Controllers\SubAccount\SubAccountDataRecordController;

Route::middleware('auth:sanctum')->prefix('sub/account')->group(function() {
    //
    Route::post('list',[SubAccountController::class,'index']);
    Route::post('add',[SubAccountController::class,'store']);
    //获取登记数据字段模板
    Route::post('data/record/columns',[SubAccountController::class,'dataColumnByShopId']);
    //
    Route::post('detail',[SubAccountController::class,'show']);
    //添加数据截图
    Route::post('data/screenShots/add',[SubAccountController::class,'addScreenShots']);

    //
    Route::prefix('manage')->group(function() {
        Route::post('departments',[SubAccountManageController::class,'departments']);
        Route::post('department/staff',[SubAccountManageController::class,'departmentStaff']);
        Route::post('assign/staff',[SubAccountManageController::class,'assignStaff']);
        Route::post('assign/logs',[SubAccountManageController::class,'assignLogs']);
        Route::post('repay',[SubAccountManageController::class,'repay']);
        Route::post('repay/logs',[SubAccountManageController::class,'repayLogs']);
        Route::post('repay/log/update',[SubAccountManageController::class,'updateRepayLog']);
        Route::post('disable',[SubAccountManageController::class,'disable']);
    });

    //
    Route::prefix('log-in-out')->group(function() {
        Route::post('list',[SubAccountLoginLogoutController::class,'index']);
        Route::post('staff/list',[SubAccountLoginLogoutController::class,'staffLoginList']);
        Route::post('yesterday/logs',[SubAccountLoginLogoutController::class,'yesterdayLogs']);
        Route::post('operate/login',[SubAccountLoginLogoutController::class,'subAccountLogin']);
        Route::post('operate/logout',[SubAccountLoginLogoutController::class,'subAccountLogout']);
        Route::post('date/record',[SubAccountLoginLogoutController::class,'getDateLoginRecord']);
    });

    //
    Route::prefix('data/record')->group(function() {
        Route::post('list',[SubAccountDataRecordController::class,'index']);
        Route::post('operate',[SubAccountDataRecordController::class,'dataRecord']);
    });


});

